<!DOCTYPE html>
<html lang="en">
<head>
    
    <meta charset="utf-8">
    <title>SecretShare - JIFF Library Documentation</title>
    
    
    
    
    
    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
    <script src="scripts/nav.js" defer></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav >
    
    <input type="text" id="nav-search" placeholder="Search" />
    
    <h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/multiparty/jiff" target="_blank" class="menu-item" id="github_link" >Github Repo</a></h2><h2><a href="./intro.html" target="_self" class="menu-item" id="github_link" >Tutorial</a></h2><h2><a href="./contributing.html" target="_self" class="menu-item" id="github_link" >Contributing to JIFF</a></h2><h3>Classes</h3><ul><li><a href="GuardedSocket.html">GuardedSocket</a><ul class='methods'><li data-type='method'><a href="GuardedSocket.html#disconnect">disconnect</a></li><li data-type='method'><a href="GuardedSocket.html#is_empty">is_empty</a></li><li data-type='method'><a href="GuardedSocket.html#resend_mailbox">resend_mailbox</a></li><li data-type='method'><a href="GuardedSocket.html#safe_disconnect">safe_disconnect</a></li><li data-type='method'><a href="GuardedSocket.html#safe_emit">safe_emit</a></li></ul></li><li><a href="helpers.Deferred.html">Deferred</a><ul class='methods'><li data-type='method'><a href="helpers.Deferred.html#reject">reject</a></li><li data-type='method'><a href="helpers.Deferred.html#resolve">resolve</a></li></ul></li><li><a href="module-jiff-client-JIFFClient.html">JIFFClient</a><ul class='methods'><li data-type='method'><a href="module-jiff-client-JIFFClient.html#add_to_barriers">add_to_barriers</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#apply_extension">apply_extension</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#can_apply_extension">can_apply_extension</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#connect">connect</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#disconnect">disconnect</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#emit">emit</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#end_barrier">end_barrier</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#executePreprocessing">executePreprocessing</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#extension_applied">extension_applied</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#free">free</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#from_crypto_provider">from_crypto_provider</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#gen_op_id">gen_op_id</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#gen_op_id2">gen_op_id2</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#gen_op_id2_preprocessing">gen_op_id2_preprocessing</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#gen_op_id_preprocessing">gen_op_id_preprocessing</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#get_preprocessing">get_preprocessing</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#has_extension">has_extension</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#has_preprocessing">has_preprocessing</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#internal_open">internal_open</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#internal_share">internal_share</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#isInitialized">isInitialized</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#isReady">isReady</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#listen">listen</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#open">open</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#open_array">open_array</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#preprocessing">preprocessing</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#preprocessingDaemon">preprocessingDaemon</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#receive_open">receive_open</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#remove_listener">remove_listener</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#reshare">reshare</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#seed_ids">seed_ids</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#share">share</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#share_array">share_array</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#start_barrier">start_barrier</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient.html#store_preprocessing">store_preprocessing</a></li></ul></li><li><a href="module-jiff-client-JIFFClient_SecretShare.html">SecretShare</a><ul class='methods'><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#add">add</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#bit_decomposition">bit_decomposition</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cadd">cadd</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cdiv">cdiv</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cdivfac">cdivfac</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#ceq">ceq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cgt">cgt</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cgteqn">cgteqn</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#clt">clt</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#clteq">clteq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cmult">cmult</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cneq">cneq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cor_bit">cor_bit</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cpow">cpow</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#csub">csub</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#cxor_bit">cxor_bit</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#div">div</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#eq">eq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#error">error</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#gt">gt</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#gteq">gteq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#if_else">if_else</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#isConstant">isConstant</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#logLEAK">logLEAK</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#lt">lt</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#lt_halfprime">lt_halfprime</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#lteq">lteq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#mult">mult</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#neq">neq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#not">not</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#open">open</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#or_bit">or_bit</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#promise_handler">promise_handler</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#refresh">refresh</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#sadd">sadd</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#sdiv">sdiv</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#seq">seq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#sgt">sgt</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#sgteq">sgteq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#slt">slt</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#slteq">slteq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#smod">smod</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#smult">smult</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#smult_bgw">smult_bgw</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#sneq">sneq</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#sor_bit">sor_bit</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#ssub">ssub</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#sub">sub</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#sxor_bit">sxor_bit</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#toString">toString</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#valueOf">valueOf</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#when_both_ready">when_both_ready</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#wThen">wThen</a></li><li data-type='method'><a href="module-jiff-client-JIFFClient_SecretShare.html#xor_bit">xor_bit</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-jiff-client.html">jiff-client</a></li></ul><h3>Namespaces</h3><ul><li><a href="bits.html">bits</a><ul class='methods'><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.bit_composition">jiffClient.protocols.bits.bit_composition</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.cadd">jiffClient.protocols.bits.cadd</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.cdivl">jiffClient.protocols.bits.cdivl</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.cdivr">jiffClient.protocols.bits.cdivr</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.ceq">jiffClient.protocols.bits.ceq</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.cgt">jiffClient.protocols.bits.cgt</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.cgteq">jiffClient.protocols.bits.cgteq</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.clt">jiffClient.protocols.bits.clt</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.clteq">jiffClient.protocols.bits.clteq</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.cmult">jiffClient.protocols.bits.cmult</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.cneq">jiffClient.protocols.bits.cneq</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.csubl">jiffClient.protocols.bits.csubl</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.csubr">jiffClient.protocols.bits.csubr</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.open">jiffClient.protocols.bits.open</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.rejection_sampling">jiffClient.protocols.bits.rejection_sampling</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.sadd">jiffClient.protocols.bits.sadd</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.sdiv">jiffClient.protocols.bits.sdiv</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.seq">jiffClient.protocols.bits.seq</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.sgt">jiffClient.protocols.bits.sgt</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.sgteq">jiffClient.protocols.bits.sgteq</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.share">jiffClient.protocols.bits.share</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.slt">jiffClient.protocols.bits.slt</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.slteq">jiffClient.protocols.bits.slteq</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.smult">jiffClient.protocols.bits.smult</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.sneq">jiffClient.protocols.bits.sneq</a></li><li data-type='method'><a href="bits.html#.jiffClient.protocols.bits.ssub">jiffClient.protocols.bits.ssub</a></li></ul></li><li><a href="handlers.html">handlers</a><ul class='methods'><li data-type='method'><a href="handlers.html#.jiffClient.handlers.build_initialization_message">jiffClient.handlers.build_initialization_message</a></li><li data-type='method'><a href="handlers.html#.jiffClient.handlers.connected">jiffClient.handlers.connected</a></li><li data-type='method'><a href="handlers.html#.jiffClient.handlers.error">jiffClient.handlers.error</a></li><li data-type='method'><a href="handlers.html#.jiffClient.handlers.initialized">jiffClient.handlers.initialized</a></li><li data-type='method'><a href="handlers.html#.jiffClient.handlers.receive_crypto_provider">jiffClient.handlers.receive_crypto_provider</a></li><li data-type='method'><a href="handlers.html#.jiffClient.handlers.receive_custom">jiffClient.handlers.receive_custom</a></li><li data-type='method'><a href="handlers.html#.jiffClient.handlers.receive_open">jiffClient.handlers.receive_open</a></li><li data-type='method'><a href="handlers.html#.jiffClient.handlers.receive_share">jiffClient.handlers.receive_share</a></li><li data-type='method'><a href="handlers.html#.jiffClient.handlers.store_public_keys">jiffClient.handlers.store_public_keys</a></li></ul></li><li><a href="helpers.html">helpers</a><ul class='methods'><li data-type='method'><a href="helpers.html#.jiffClient.helpers.array_equals">jiffClient.helpers.array_equals</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.bits_to_number">jiffClient.helpers.bits_to_number</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.bLog">jiffClient.helpers.bLog</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.ceil">jiffClient.helpers.ceil</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.extended_gcd">jiffClient.helpers.extended_gcd</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.floor">jiffClient.helpers.floor</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.get_party_number">jiffClient.helpers.get_party_number</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.is_prime">jiffClient.helpers.is_prime</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.mod">jiffClient.helpers.mod</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.number_to_bits">jiffClient.helpers.number_to_bits</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.pow_mod">jiffClient.helpers.pow_mod</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.random">jiffClient.helpers.random</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.sort_ids">jiffClient.helpers.sort_ids</a></li><li data-type='method'><a href="helpers.html#.jiffClient.helpers.Zp_equals">jiffClient.helpers.Zp_equals</a></li></ul></li><li><a href="hooks.html">hooks</a><ul class='methods'><li data-type='method'><a href="hooks.html#.computeShares">computeShares</a></li><li data-type='method'><a href="hooks.html#.execute_array_hooks">execute_array_hooks</a></li></ul></li><li><a href="protocols.html">protocols</a><ul class='methods'><li data-type='method'><a href="protocols.html#.jiffClient.protocols.generate_beaver_bgw">jiffClient.protocols.generate_beaver_bgw</a></li><li data-type='method'><a href="protocols.html#.jiffClient.protocols.generate_random_and_quotient">jiffClient.protocols.generate_random_and_quotient</a></li><li data-type='method'><a href="protocols.html#.jiffClient.protocols.generate_random_bit_bgw">jiffClient.protocols.generate_random_bit_bgw</a></li><li data-type='method'><a href="protocols.html#.jiffClient.protocols.generate_random_bit_smult">jiffClient.protocols.generate_random_bit_smult</a></li><li data-type='method'><a href="protocols.html#.jiffClient.protocols.generate_random_bits">jiffClient.protocols.generate_random_bits</a></li><li data-type='method'><a href="protocols.html#.jiffClient.protocols.generate_random_number">jiffClient.protocols.generate_random_number</a></li><li data-type='method'><a href="protocols.html#.jiffClient.protocols.generate_zero">jiffClient.protocols.generate_zero</a></li><li data-type='method'><a href="protocols.html#.jiffClient.protocols.rejection_sampling">jiffClient.protocols.rejection_sampling</a></li></ul></li><li><a href="utils.html">utils</a><ul class='methods'><li data-type='method'><a href="utils.html#.jiffClient.utils.bit_combinator">jiffClient.utils.bit_combinator</a></li><li data-type='method'><a href="utils.html#.jiffClient.utils.many_secret_shares">jiffClient.utils.many_secret_shares</a></li><li data-type='method'><a href="utils.html#.jiffClient.utils.resolve_many_secrets">jiffClient.utils.resolve_many_secrets</a></li></ul></li></ul>
</nav>

<div id="main">
    
    <h1 class="page-title">SecretShare</h1>
    

    




<section>

<header>
    
        <h2>
            <span class="ancestors"><a href="module-jiff-client.html">jiff-client</a><a href="module-jiff-client-JIFFClient.html">~JIFFClient</a>#</span>
        
        SecretShare
        </h2>
        
    
</header>

<article>
    
        <div class="container-overview">
        
            

    

    <h4 class="name" id="SecretShare"><span class="type-signature"></span>new SecretShare<span class="signature">(value, holders, threshold, Zp)</span><span class="type-signature"></span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="jiff-client.js.html">jiff-client.js</a>, <a href="jiff-client.js.html#line314">line 314</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>The constructor function used by JIFF to create a new share. This can be overloaded by extensions to create custom shares.
Modifying this will modify how shares are generated in the BASE JIFF implementation.
A share is a value/promise wrapped with a share object.
A share also has methods for performing operations.</p>
</div>









    <h5>Examples</h5>
    
    <pre class="prettyprint"><code>// A share whose value is 10: the secret is still unknown, 10 is only one share
var share = new jiffClient.SecretShare(10, [1, 2, 3], 3, jiffClient.Zp);</code></pre>

    <pre class="prettyprint"><code>// A share whose value depends on some promise
var share = new jiffClient.SecretShare(promise, [1, 2, 3, 4], 4, jiffClient.Zp);</code></pre>




    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>value</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type">promise</span>


            
            </td>

            

            

            <td class="description last"><p>the value of the share, or a promise to it.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>holders</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>

            

            

            <td class="description last"><p>the parties that hold all the corresponding shares (must be sorted).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>threshold</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>the min number of parties needed to reconstruct the secret.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>Zp</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>the mod under which this share was created.</p></td>
        </tr>

    
    </tbody>
</table>



















        
        </div>
    

    

    

    
    
    

     

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id="holders"><span class="type-signature"></span>holders<span class="type-signature"> :Array</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line31">line 31</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Array of party ids who hold shares of the corresponding secret</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Array</span>


        </li>
    </ul>






        
            
<h4 class="name" id="jiff"><span class="type-signature"></span>jiff<span class="type-signature"> :<a href="module-jiff-client-JIFFClient.html">module:jiff-client~JIFFClient</a></span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line64">line 64</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>The jiff client instance this share belongs to</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type"><a href="module-jiff-client-JIFFClient.html">module:jiff-client~JIFFClient</a></span>


        </li>
    </ul>






        
            
<h4 class="name" id="ready"><span class="type-signature"></span>ready<span class="type-signature"> :boolean</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line15">line 15</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Indicates if the secret share's value is ready or still a promise</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">boolean</span>


        </li>
    </ul>






        
            
<h4 class="name" id="threshold"><span class="type-signature"></span>threshold<span class="type-signature"> :number</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line38">line 38</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>The sharing threshold</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">number</span>


        </li>
    </ul>






        
            
<h4 class="name" id="value"><span class="type-signature"></span>value<span class="type-signature"> :number|promise</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line23">line 23</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>The value of the share (or a promise to it)</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">number</span>
|

<span class="param-type">promise</span>


        </li>
    </ul>






        
            
<h4 class="name" id="Zp"><span class="type-signature"></span>Zp<span class="type-signature"> :number</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line46">line 46</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>The field prime under which the corresponding secret is shared</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">number</span>


        </li>
    </ul>






        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(o)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line16">line 16</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Addition.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>









    <h5>Example</h5>
    
    <pre class="prettyprint"><code>var shares = jiffClient.share(input);
// this will add two secret shared values together
var sum1 = shares[1].add(shares[2]);
// this will add 3 to the secret input from party 1
var sum2 = shares[1].add(3);
// both sum1 and sum2 are SecretShares</code></pre>




    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            

            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="bit_decomposition"><span class="type-signature"></span>bit_decomposition<span class="signature">(op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_protocols.js.html">client/protocols/numbers/protocols.js</a>, <a href="client_protocols_numbers_protocols.js.html#line46">line 46</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Bit Decomposition: Transform existing share to an array of bit shares.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>an array of secret shares of bits of length [ceil(log_2(this.Zp))], where
index 0 represents the least significant bit.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cadd"><span class="type-signature"></span>cadd<span class="signature">(cst)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line3">line 3</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Addition with a constant.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>the constant to add.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cdiv"><span class="type-signature"></span>cdiv<span class="signature">(cst, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line328">line 328</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Integer divison with a share and a constant (this / cst).</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the constant to divide by.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cdivfac"><span class="type-signature"></span>cdivfac<span class="signature">(cst)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line66">line 66</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Division by a constant factor of the number represented by the share.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>the constant by which to divide the share.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="ceq"><span class="type-signature"></span>ceq<span class="signature">(cst, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line321">line 321</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Equality test with a constant.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the constant to compare with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 0 if this = o, and 1 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cgt"><span class="type-signature"></span>cgt<span class="signature">(cst, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line161">line 161</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Greater than with a constant.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the constant to compare with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.default ids suffice when all parties execute the
instructions in the same order.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &gt; cst, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cgteqn"><span class="type-signature"></span>cgteqn<span class="signature">(cst, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line138">line 138</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Greater than or equal with a constant.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the constant to compare with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &gt;= cst, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="clt"><span class="type-signature"></span>clt<span class="signature">(cst, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line225">line 225</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Less than with a constant.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the constant to compare with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &lt; cst, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="clteq"><span class="type-signature"></span>clteq<span class="signature">(cst, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line202">line 202</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Less than or equal with a constant.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the constant to compare with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &lt;= cst, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cmult"><span class="type-signature"></span>cmult<span class="signature">(cst)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line45">line 45</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Multiplication by a constant.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>the constant to multiply to this share.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cneq"><span class="type-signature"></span>cneq<span class="signature">(cst, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line343">line 343</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Unequality test with a constant.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the constant to compare with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 0 if this = o, and 1 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cor_bit"><span class="type-signature"></span>cor_bit<span class="signature">(cst)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_booleans_boolean.js.html">client/protocols/booleans/boolean.js</a>, <a href="client_protocols_booleans_boolean.js.html#line22">line 22</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>bitwise-OR with a constant (BOTH BITS).</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>the constant bit to OR with (0 or 1).</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cpow"><span class="type-signature"></span>cpow<span class="signature">(cst, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line452">line 452</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Fast (modular) exponentiation with constant exponent via repeated squaring.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the constant to multiply to this share.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="csub"><span class="type-signature"></span>csub<span class="signature">(cst)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line24">line 24</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Subtraction with a constant.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>the constant to subtract from this share.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="cxor_bit"><span class="type-signature"></span>cxor_bit<span class="signature">(cst)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_booleans_boolean.js.html">client/protocols/booleans/boolean.js</a>, <a href="client_protocols_booleans_boolean.js.html#line3">line 3</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>bitwise-XOR with a constant (BOTH BITS).</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>cst</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>the constant bit to XOR with (0 or 1).</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="div"><span class="type-signature"></span>div<span class="signature">(o, l, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line240">line 240</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Integer Divison.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>l</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the maximum bit length of the two shares.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="eq"><span class="type-signature"></span>eq<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line200">line 200</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Equals.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="error"><span class="type-signature"></span>error<span class="signature">(error)</span><span class="type-signature"></span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line100">line 100</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Logs an error. Passes the error on to the associated jiff client instance's error</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>error</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">error</span>


            
            </td>

            

            

            <td class="description last"><p>the error to log</p></td>
        </tr>

    
    </tbody>
</table>



















        
            

    

    <h4 class="name" id="gt"><span class="type-signature"></span>gt<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line140">line 140</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Greater than.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="gteq"><span class="type-signature"></span>gteq<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line120">line 120</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Greater or equal.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="if_else"><span class="type-signature"></span>if_else<span class="signature">(trueVal, falseVal, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_booleans_boolean.js.html">client/protocols/booleans/boolean.js</a>, <a href="client_protocols_booleans_boolean.js.html#line111">line 111</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Simulate an oblivious If-else statement with a single return value.
Should be called on a secret share of a bit: 0 representing false, and 1 representing true
If this is a share of 1, a new sharing of the element represented by the first parameter is returned,
otherwise, a new sharing of the second is returned.</p>
</div>









    <h5>Example</h5>
    
    <pre class="prettyprint"><code>// a and b are secret shares
// cmp will be a secret share of either 1 or 0, depending on whether a or b is greater
var cmp = a.gt(b);

// max is set to the greater value, without revealing the value or the result of the inequality
var max = cmp.if_else(a, b);</code></pre>




    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>trueVal</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>
|

<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the value/share to return if this is a sharing of 1.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>falseVal</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>
|

<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the value/share to return if this is a sharing of 0.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>a new sharing of the result of the if.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="isConstant"><span class="type-signature"></span>isConstant<span class="signature">(o)</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line3">line 3</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Checks if the given parameter is a constant, used to determine whether constant or secret
operations should be executed when the generic version of an operation is called</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number/object</span>


            
            </td>

            

            

            <td class="description last"><p>the parameter to determine.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>true if o is a valid constant, false otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="logLEAK"><span class="type-signature"></span>logLEAK<span class="signature">(tag, parties<span class="signature-attributes">opt</span>, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {promise}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line111">line 111</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Logs the value represented by this share to the console
WARNING: THIS LEAKS INFORMATION AND MUST BE USED ONLY TO DEBUG ON FAKE DATA</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>tag</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>accompanying tag to display in the console</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>parties</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;(number|string)></span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>[holders[0]</code>
                
                </td>
            

            <td class="description last"><p>the parties which will display the log</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">number</span>
|

<span class="param-type">object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>same as open</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>a promise to the value represented by this share after logging it, null if party is not in parties</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">promise</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="lt"><span class="type-signature"></span>lt<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line180">line 180</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Less than.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="lt_halfprime"><span class="type-signature"></span>lt_halfprime<span class="signature">(op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line365">line 365</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Checks whether the share is less than half the field size.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="lteq"><span class="type-signature"></span>lteq<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line160">line 160</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Less or equal.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="mult"><span class="type-signature"></span>mult<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line58">line 58</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Multiplication.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this multiplication (and internally, the corresponding beaver triplet).
This id must be unique, and must be passed by all parties to the same instruction.
this ensures that every party gets a share from the same triplet for every matching instruction. An automatic id
is generated by increasing a local counter, default ids suffice when all parties execute the
instructions in the same order. Only used if secret multiplication is used.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="neq"><span class="type-signature"></span>neq<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line220">line 220</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Not Equals.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="not"><span class="type-signature"></span>not<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_booleans_boolean.js.html">client/protocols/booleans/boolean.js</a>, <a href="client_protocols_booleans_boolean.js.html#line99">line 99</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Negation of a bit.
This has to be a share of a BIT in order for this to work properly.</p>
</div>

























<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result (negated bit).</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="open"><span class="type-signature"></span>open<span class="signature">(parties<span class="signature-attributes">opt</span>, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {promise}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line172">line 172</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li>jiff-instance#open</li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>Shortcut for opening/revealing the value of this share. Alias for open in jiff-instance</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>parties</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>all_parties</code>
                
                </td>
            

            <td class="description last"><p>an array with party ids (1 to n) of receiving parties</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">number</span>
|

<span class="param-type">object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>same as open</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>a (JQuery) promise to the open value of the secret, null if the party is not specified in
the parties array as a receiver</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">promise</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="or_bit"><span class="type-signature"></span>or_bit<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line100">line 100</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic OR for bits (both this and o have to be bits to work correctly).
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.
Only used if secret or is used..</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="promise_handler"><span class="type-signature"></span>promise_handler<span class="signature">(value)</span><span class="type-signature"></span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line136">line 136</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Handler for when this share's promise (if any) is resolved</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>value</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last"><p>the value of the share after it was resolved</p></td>
        </tr>

    
    </tbody>
</table>



















        
            

    

    <h4 class="name" id="refresh"><span class="type-signature"></span>refresh<span class="signature">(op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_protocols.js.html">client/protocols/numbers/protocols.js</a>, <a href="client_protocols_numbers_protocols.js.html#line3">line 3</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Reshares/refreshes the sharing of this number, used before opening to keep the share secret.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id with which to tag the messages sent by this refresh, by default
an automatic operation id is generated by increasing a local counter, default operation ids
suffice when all parties execute the instructions in the same order.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>a new share of the same number.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="sadd"><span class="type-signature"></span>sadd<span class="signature">(o)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line89">line 89</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Addition of two secret shares.</p>
</div>









    <h5>Example</h5>
    
    <pre class="prettyprint"><code>// share a value with all parties, and sum the values of all shares
var shares = jiff_instance.share(x);
var sum = shares[1];
for (var i = 2; i &lt;= jiff_instance.party_count; i++) {
 sum = sum.sadd(shares[i]);
}</code></pre>




    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            

            

            <td class="description last"><p>the share to add to this share.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="sdiv"><span class="type-signature"></span>sdiv<span class="signature">(o, l<span class="signature-attributes">opt</span>, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line286">line 286</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Integer divison with two shares (this / o)</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the share to divide by.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>l</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>ceil(log_2(this.Zp))</code>
                
                </td>
            

            <td class="description last"><p>the maximum bit length of either operands.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="seq"><span class="type-signature"></span>seq<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line265">line 265</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Equality test with two shares.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the share to compare with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this = o, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="sgt"><span class="type-signature"></span>sgt<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line32">line 32</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Greater than with another share.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other share.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &gt; o, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="sgteq"><span class="type-signature"></span>sgteq<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line3">line 3</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Greater than or equal with another share.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other share.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &gt;= o, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="slt"><span class="type-signature"></span>slt<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line90">line 90</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Less than with another share.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other share.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &lt; o, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="slteq"><span class="type-signature"></span>slteq<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line61">line 61</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Less than or equal with another share.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other share.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &lt;= o, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="smod"><span class="type-signature"></span>smod<span class="signature">(o, l<span class="signature-attributes">opt</span>, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line410">line 410</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Remainder with two shares (this % o)</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the modulus to apply</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>l</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>ceil(log_2(this.Zp))</code>
                
                </td>
            

            <td class="description last"><p>the maximum bit length of either operands.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="smult"><span class="type-signature"></span>smult<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line156">line 156</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Multiplication of two secret shares through Beaver Triplets.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the share to multiply with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this multiplication (and internally, the corresponding beaver triplet).
This id must be unique, and must be passed by all parties to the same instruction.
this ensures that every party gets a share from the same triplet for every matching instruction. An automatic id
is generated by increasing a local counter, default ids suffice when all parties execute the
instructions in the same order.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="smult_bgw"><span class="type-signature"></span>smult_bgw<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line236">line 236</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Multiplication of two secret shares through BGW protocol.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the share to multiply with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this multiplication (and internally, the corresponding beaver triplet).
This id must be unique, and must be passed by all parties to the same instruction.
this ensures that every party gets a share from the same triplet for every matching instruction. An automatic id
is generated by increasing a local counter, default ids suffice when all parties execute the
instructions in the same order.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="sneq"><span class="type-signature"></span>sneq<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_comparison.js.html">client/protocols/numbers/comparison.js</a>, <a href="client_protocols_numbers_comparison.js.html#line293">line 293</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Unequality test with two shares.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the share to compare with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result, the final result is 0 if this = o, and 1 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="sor_bit"><span class="type-signature"></span>sor_bit<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>|<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_booleans_boolean.js.html">client/protocols/booleans/boolean.js</a>, <a href="client_protocols_booleans_boolean.js.html#line70">line 70</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>OR of two secret shares OF BITS.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the share to OR with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>
<ul>
        <li>
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &lt; o, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>
</li>
    
        <li>
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>
</li>
    </ul>



        
            

    

    <h4 class="name" id="ssub"><span class="type-signature"></span>ssub<span class="signature">(o)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_numbers_arithmetic.js.html">client/protocols/numbers/arithmetic.js</a>, <a href="client_protocols_numbers_arithmetic.js.html#line127">line 127</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Subtraction of two secret shares.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            

            

            <td class="description last"><p>the share to subtract from this share.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="sub"><span class="type-signature"></span>sub<span class="signature">(o)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line41">line 41</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic Subtraction.
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            

            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="sxor_bit"><span class="type-signature"></span>sxor_bit<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>|<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_booleans_boolean.js.html">client/protocols/booleans/boolean.js</a>, <a href="client_protocols_booleans_boolean.js.html#line41">line 41</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>bitwise-XOR of two secret shares OF BITS.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the share to XOR with.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>
<ul>
        <li>
<div class="param-desc">
    <p>this party's share of the result, the final result is 1 if this &lt; o, and 0 otherwise.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>
</li>
    
        <li>
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>
</li>
    </ul>



        
            

    

    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line88">line 88</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Gets a string representation of this share</p>
</div>

























<h5>Returns:</h5>

        
<div class="param-desc">
    <p>the id and value of the share as a string</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="valueOf"><span class="type-signature"></span>valueOf<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line73">line 73</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Gets the value of this share</p>
</div>

























<h5>Returns:</h5>

        
<div class="param-desc">
    <p>the value (undefined if not ready yet)</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">number</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="when_both_ready"><span class="type-signature"></span>when_both_ready<span class="signature">(o, cb)</span><span class="type-signature"> &rarr; {value|promise}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line149">line 149</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Executes callback when both this share and o are ready and returns the result (or a promise to the result)</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">SecretShare</span>


            
            </td>

            

            

            <td class="description last"><p>the other share object.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>cb</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>the callback to execute.</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>either the return value of cb() or a promise to it</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">value</span>
|

<span class="param-type">promise</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="wThen"><span class="type-signature"></span>wThen<span class="signature">(onFulfilled, onRejected<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {promise|value}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_share.js.html">client/share.js</a>, <a href="client_share.js.html#line187">line 187</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Wrapper around share.value.then.
In case share is ready (its promise is resolved and cleared)
The callback is executed immediately.
Does not support chaining</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>onFulfilled</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>callback for success, called with this.value as parameter</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>onRejected</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>this.error</code>
                
                </td>
            

            <td class="description last"><p>callback for errors</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>either the result of executing onFulfilled or a promise to it</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">promise</span>
|

<span class="param-type">value</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="xor_bit"><span class="type-signature"></span>xor_bit<span class="signature">(o, op_id<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a>}</span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="client_protocols_generic.js.html">client/protocols/generic.js</a>, <a href="client_protocols_generic.js.html#line80">line 80</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Generic XOR for bits (both this and o have to be bits to work correctly).
Uses either the constant or secret version of this operator depending on type of paramter.</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>o</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>
|

<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>the other operand (can be either number or share).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>op_id</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    <code>auto_gen()</code>
                
                </td>
            

            <td class="description last"><p>the operation id which is used to identify this operation.
This id must be unique, and must be passed by all parties to the same instruction, to
ensure that corresponding instructions across different parties are matched correctly.
Only used if secret xor is used..</p></td>
        </tr>

    
    </tbody>
</table>
















<h5>Returns:</h5>

        
<div class="param-desc">
    <p>this party's share of the result.</p>
</div>



<dl class="param-type">
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="module-jiff-client-JIFFClient_SecretShare.html">module:jiff-client~JIFFClient#SecretShare</a></span>


    </dd>
</dl>

    



        
    

    

    
</article>

</section>




    
    
</div>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Jun 11 2020 12:17:15 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>

<script src="scripts/search.js" defer></script>



</body>
</html>
